package com.lplb.api.admin.service.consumer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lplb.api.admin.model.dto.AdminDictDTO;
import com.lplb.api.admin.model.vo.AdminDictVO;
import com.lplb.common.core.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 字典表 用户端服务接口
 * </p>
 *
 * @author ws
 * @date 2020-07-21
 */
@Api(value = "UIAdminDictService", tags = "yh--字典表")
@RequestMapping(value = "/consumer/adminDict",name = "字典表")
public interface UIAdminDictService {


    @RequestMapping(value = "/findPage", method = RequestMethod.GET)
    @ApiOperation("分页查询")
    @ApiImplicitParams({
    @ApiImplicitParam(name = "current", value = "页数", required = true, paramType = "query", example = "1"),
    @ApiImplicitParam(name = "size", value = "记录数", required = true, paramType = "query", example = "20"),
    })
    public R<IPage<AdminDictVO>> findPage();


    @RequestMapping(value = "/findList", method = RequestMethod.GET)
    @ApiOperation("查询所有")
    R<List<AdminDictVO>> findList();


    @RequestMapping(value = "/findId", method = RequestMethod.GET)
    @ApiOperation("ID查询")
    @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "query")
    public R<AdminDictVO> findId(@RequestParam String id);


    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ApiOperation("添加")
    public R<Void> add(@RequestBody @Validated AdminDictDTO dto);


    @RequestMapping(value = "/upd", method = RequestMethod.PUT)
    @ApiOperation("ID编辑")
    public R<Void> upd(@RequestBody @Validated AdminDictDTO dto);


    @RequestMapping(value = "/removeId", method = RequestMethod.DELETE)
    @ApiOperation("ID删除")
    @ApiImplicitParam(name = "id", value = "主键ID", required = true, paramType = "query")
    public R<Void> removeId(@RequestParam String id);
}
